import request from '@/utils/request.ts';
import type { UserLoginData, UserInfoRes, UserLoginRes } from './type.ts';
import { ResponseData } from '../type.js';
// 用户相关接口
// api接口
enum API {
  USER_LOGIN = '/admin/acl/index/login',
  USER_INFO = '/admin/acl/index/info',
  USER_LOGOUT = '/admin/acl/index/logout'
}

// 登录接口
export const reqLogin = (data: UserLoginData) =>
  request.post<any, UserLoginRes>(API.USER_LOGIN, data);
// 获取用户信息接口
export const reqUserInfo = () => request.get<any, UserInfoRes>(API.USER_INFO);
// 退出登录
export const reqLogout = () => request.post<any, ResponseData>(API.USER_LOGOUT);
